package com.xplay.xpocker.controller;

import com.xplay.xpocker.config.ResultFul;
import com.xplay.xpocker.constant.RoomTypeEnum;
import com.xplay.xpocker.dvo.AbstractRoom;
import com.xplay.xpocker.entity.GameRuRoom;
import com.xplay.xpocker.room.RoomStrategy;
import com.xplay.xpocker.service.gaming.GameRuRoomService;
import com.xplay.xpocker.service.gaming.GameRuRoomUserService;
import com.xplay.xpocker.util.Assertion;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Slf4j
@RestController
@RequestMapping(value = "user", produces = "application/json;charset=UTF-8")
public class UserController {
    @Autowired
    private GameRuRoomService roomService;

    @PostMapping(value = "hook")
    public ResultFul<String> setUserHook(Boolean hook) {
        roomService.updateUserState(hook, null);
        return ResultFul.ok("OK");
    }
}
